// pages/search/search.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    goodsList: [
    ],
    value: '',
    tab: 0,
    isFocus: false,
    inputValue: "",
    selectData:[],
    change:["可回收垃圾","有害垃圾","厨余垃圾","其他垃圾","其他垃圾"]
  },
  changeFocus(){
this.setData({
  isFocus:false
})
  },
  click: function (options) {
    // console.log()
    let data=this.data.goodsList[options.currentTarget.dataset.id]
    this.setData({
      isFocus:true,
      selectData:data
    })
    // let that = this;
    // let result=this.data.goodsList[options.currentTarget.dataset.id]
    // wx.navigateTo({
    //   url: '/pages/detail/detail?'+`type=${result.type}&name=${result.name}&contain=${result.contain}&explain=${result.explain}&tip=${result.tip}`
    // })
    //浮窗显示
  },
  handleInput(e) {
    this.setData({
      value: e.detail.value
    })
    this.setData({
      isFocus: true
    })
  },
  handleCancel() {
    this.setData({
      inputValue: "",
      isFocus: false,
      value: ""
    })
  },
  unmount(){
this.setData({
  isFocus:false
})
  },
  Cancel() {
    this.setData({
      tab: 0
    })
  },


  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    console.log(JSON.parse(options.data) )
    this.setData({
      // value: options.type
      goodsList:JSON.parse(options.data) 
    })
  },
})